import React from 'react'
import Store from '../../Store/store'
import { getMoviemsgAction } from '../../Store/Actions/movieAction'
export default function Movie() {
  const { count } = Store.getState().count
  const { movieList } = Store.getState().movie
  const getMovieMsghandle = () => {
    Store.dispatch(getMoviemsgAction(movieList))
    console.log(movieList);
  }

  return (
    <div>
      <hr />
      <h4>我拿到的电影数量是{count}</h4>
      <button onClick={getMovieMsghandle}>获取电影列表信息</button>
      <h1>周末热映电影列表</h1>
      <ul>
        {movieList.map(item => {
          return <li >{item.albumName}</li>
        })}
      </ul>
    </div>
  )
}
